<?php $this->load->view('Admin/navbar');?>
  <!-- Tab panes -->
  <div class="tab-content" style="margin-top: 10px;">
    <div role="tabpanel" class="tab-pane" id="<?=$focusTag?>">
		<form class="form-inline" method="GET" name="query" id="query">
		<input type="hidden" name="c" id="c" value="Admin">
		<input type="hidden" name="m" id="m" value="timeUnitList">
		<input type="hidden" name="tab" id="tab" value="timeUnit">
		<div class="form-group">
		    <label for="year">所属年份：</label>
		    <select class="form-control" id="year" name="year">
		      <option value="">请选择</option>
			</select>
	  	</div>
		  <div class="form-group">
		  	<button type="submit" class="btn btn-default btn-primary">搜索</button>
		  </div>
	    	<button type="button" class="btn btn-default btn-primary" onclick="newWindow('新增时段','<?=printUrl('Admin','timeUnitAdd')?>',400,600)">添加</button>
		</form>
    	<table style="margin-top: 10px;" class="table table-bordered table-condensed">
			<thead>
			  <tr>
			    <th class="bg-primary text-center">时段序号</th>
			    <th class="bg-primary text-center">时段名称</th>
			    <th class="bg-primary text-center">年份</th>
			    <th class="bg-primary text-center">开始时间</th>
			    <th class="bg-primary text-center">结束时间</th>
			    <th class="bg-primary text-center">所含周数</th>
			    <th class="bg-primary text-center">操作</th>
			  </tr>
			</thead>
			<tbody>
			<?php foreach ($timeUnitList as $k => $v) {?>
			  <tr align="center">
			  	<td><?=$v['id']?></td>
			  	<td><?=$v['name']?></td>
			  	<td><?=$v['year']?></td>
			  	<td><?=$v['startTime']?></td>
			  	<td><?=$v['endTime']?></td>
			  	<td><?=$v['weekNum']?></td>
			  	<td>
			  		<button type="button" class="btn btn-default btn-primary" onclick="newWindow('修改时段','<?=printUrl('Admin','timeUnitAdd', array('id'=>$v['id']))?>',400,600)">修改</button>
			  	</td>
			  </tr>
			<?php } ?>
			</tbody>
		</table>
    </div>
</div>
<script type="text/javascript">
	$(function(){
		loadYearList('year',<?=$year ? $year : 0?>);
	});
</script>
<?php $this->load->view('Admin/foot');?>